<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>Dashboard Template for Bootstrap</title>

<!-- Bootstrap core CSS -->
<link href="/libs/bootstrap/4.0/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="/libs/bootstrap/4.0/css/dashboard.css" rel="stylesheet">
</head>

<body>
	<div id="header"></div>
	<div class="container-fluid">
		<div class="row">
			<div id="menu"></div>

			<main class="col-sm-9 offset-sm-3 col-md-10 offset-md-2 pt-3">
			<div id="rptList" style="width: 80%; hight: 100%; float: left；">
				<table class="table table-hover" id="cusTable">
				</table>
			</div>
			</main>
		</div>
	</div>

	<!-- Bootstrap core JavaScript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->
	<script src="/libs/js/jquery-3.1.1.slim.min.js"
		integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n"
		crossorigin="anonymous"></script>
	<script src="/libs/js/tether.min.js"
		integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb"
		crossorigin="anonymous"></script>
	<script src="/libs/bootstrap/4.0/js/bootstrap.min.js"></script>
	<script src="/libs/js/common.js"></script>
	<script src="/libs/js/jquery.js"></script>
	<script src="/libs/js/dashboard/index.js"></script>
	<script src="/libs/bootstrap/4.0/js/bootstrap-table.js"></script>

	<script type="text/javascript">
		$("#header").load("/header.html")
		$("#menu").load("/menu.html")
		addActive("m_reports_recommend");
		$('#cusTable').bootstrapTable('destroy');
		function loadData() {
			$('#cusTable').bootstrapTable('destroy');
			$("#cusTable").bootstrapTable(
					{
						method : "get", //使用get请求到服务器获取数据  
						url : "/ui/stockReports/queryRptsRecommend", //获取数据的Servlet地址  
						striped : true, //表格显示条纹  
						pagination : true, //启动分页
						cache : false,
						pageSize : 10, //每页显示的记录数  
						//pageNumber:1, //当前第几页  
						pageList : [ 10, 15, 20, 50 ], //记录数可选列表  
						search : false, //是否启用查询  
						//showColumns: true,  //显示下拉框勾选要显示的列  
						//showRefresh: true,  //显示刷新按钮  
						sidePagination : "server", //表示服务端请求
						//设置为undefined可以获取pageNumber，pageSize，searchText，sortName，sortOrder  
						//设置为limit可以获取limit, offset, search, sort, order  
						queryParamsType : "undefined",
						queryParams : function queryParams(params) { //设置查询参数  
							var param = {
								pageNo : params.pageNumber,
								pageSize : params.pageSize
							};
							return param;
						},
						columns : [ {
							field : 'code',
							title : '代码'
						}, {
							field : 'updateDate',
							title : '更新日期',
							formatter : function(value, row, index) {
								return formDate(value);
							}
						}, {
							field : 'starBreakPoint',
							title : '业绩拐点指数(季度)'
						}, {
							field : 'starIncreaseUp',
							title : '业绩增长指数(季度)'
						}, {
							field : 'profitYearOnYear',
							title : '2年业绩同比指数'
						}, {
							field : 'profitJiduOnJidu',
							title : '季度环比增长'
						}, {
							field : 'profit3YearInc',
							title : '最近3年赚钱放大',
							formatter : function(value, row,index) {
								if(value){
									return value;
								}else{
									return "-";
								}
							}
						}, {
							field : 'maybeSt',
							title : 'ST风险',
							formatter : function(value, row,index) {
								if(value){
									return "ST风险";
								}else{
									return "-";
								}
							}
						} ],
						responseHandler : function responseHandler(res) {
							//alert(res.bizData);
							var s1 = JSON.stringify(res.bizData.list);
							var s2 = '{"total":' + res.bizData.total
									+ ',"rows":' + s1 + '}';
							//alert(s2);
							return eval('(' + s2 + ')')
						},
						onLoadSuccess : function() { //加载成功时执行
							$("#rptList").show();
						},
						onLoadError : function() { //加载失败时执行  
							alert("加载数据失败");
						}
					});
		}
		loadData();
	</script>
</body>
</html>
